﻿@model List<LeEdu.MODEL.Topic>

@{
    Layout = null;


}

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->
<!-- 网页头部分布视图 -->
@Html.Partial("~/Views/Shared/HouTai_Header.cshtml")

<body>

    <script>
        //全选
        function QX(che) {
            if ($('#ch')[0].checked) {

                $('input[name="check"]').prop("checked", true);
            }
            else {
                $('input[name="check"]').prop("checked", false);
            }
        }


        //批量删除
        function PLDelEstimate() {
            var a = "";
            $('input[name="check"]:checked').each(function () {
                a += $(this).val() + ',';
            });

            if (a == "") {

                alert('选择删除的项！');
                return;
            }
            a = a.substring(0, a.length - 1);

            if (confirm('确定删除吗？')) {
                $.post('/Course/PLDelTp', { id: a }, function (da) {
                    if (da == 1) {
                        alert('删除成功！');
                        location.href = '/Course/ShowTopic';
                    }
                    else {
                        alert('删除失败！');
                    }
                })
            }
        }
    </script>

    <!-- 网页导航菜单分布视图 -->
    @Html.Partial("~/Views/Shared/HouTai_DaoHang.cshtml")

    <div class="container">
        <div class="row">

            <!-- 网页左侧菜单分布视图 -->
            @Html.Partial("~/Views/Shared/HouTai_Left_Menu_Course.cshtml")


            <div class="col-md-10">
                <div class="page-header clearfix">
                    <h1 class="pull-left">话题管理</h1>
                    <div class="pull-right">

                    </div>
                </div>




                <ul class="nav nav-tabs mbm">
                    <li class="active">
                        <a href="/admin/review">课程话题</a>
                    </li>
                    <li>
                        <a href="/admin/classroom/review">班级话题</a>
                    </li>
                </ul>



                <form id="review-search-form" class="form-inline well well-sm" action="/Course/ShowTopic" method="post">
                    <div class="form-group">
                        <select class="form-control" name="Attribute">
                            <option value="">属性</option>
                            <option value="1">精</option>
                            <option value="2">置顶</option>

                        </select>
                    </div>

                    <div class="form-group">
                        <input class="form-control" placeholder="作者" name="UserInfoId" value="" type="text">
                    </div>
                    <div class="form-group">
                        <input class="form-control" placeholder="标题关键词" name="TopicTitle" value="" type="text">
                    </div>
                    <button class="btn btn-primary" type="submit" name="sousuo">搜索</button>
                </form>
                <div id="review-table-container">
                    <table class="table table-striped table-hover" id="review-table">
                        <thead>
                            <tr>
                                <th></th>
                                <th>帖子</th>
                                <th>回复查看</th>
                                <th>属性</th>
                                <th>作者</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>



                        <tbody>

                            @{
                                foreach (var item in Model)
                                {
                                    <tr>
                                        <td><input data-role="batch-select" id="che" name="check" value="@item.ID" type="checkbox"></td>
                                        <td>@item.TopicTitle</td>
                                        @*<td>@item.TopicContent.</td>*@
                                        <td>
                                            @item.Reply / @item.See
                                        </td>
                                        <td>
                                            @if (item.Attribute == 0)
                                            {
                                                <a href="/Course/DzNotes/@item.ID"><span class="label label-default">精</span></a>


                                                <a href="/Course/DzNotes/@item.ID">
                                                    <span class="label label-default">顶</span>
                                                </a>
                                            }
                                            else
                                            {
                                                if (item.Attribute == 1)
                                                {
                                                    <a href="/Course/DzNotes/@item.ID">
                                                        <span class="label label-success">精</span>
                                                    </a>

                                                    <a href="/Course/DzNotes/@item.ID">
                                                        <span class="label label-default">顶</span>
                                                    </a>
                                                }
                                                else
                                                {
                                                    if (item.Attribute == 2)
                                                    {<a href="/Course/DzNotes/@item.ID"><span class="label label-default">精</span></a>



                                                    <a href="/Course/DzNotes/@item.ID">
                                                        <span class="label label-success">顶</span>
                                                    </a>
                                                    }
                                                    else
                                                    {
                                                        if (item.Attribute == 3)
                                                        {
                                                            <span class="label label-success">精</span>


                                                            <a href="javascript:;" data-set-url="/course/120/thread/9/stick" data-cancel-url="/course/120/thread/9/unstick" class="promoted-label">
                                                                <span class="label label-success">顶</span>
                                                            </a>
                                                        }
                                                        else { }
                                                    }
                                                }
                                            }


                                        </td>
                                        <td>@item.UserInfo.Uname  @item.TopicTime</td>
                                        <td>
                                            <a class="btn btn-default btn-sm" data-role="item-delete" data-name="评价" data-url="/admin/review/4/delete" href="/Course/DelTp/@item.ID" onclick="return confirm('您确定要删除吗？')">删除</a>
                                        </td>
                                    </tr>
                                }
                            }
                        </tbody>
                    </table>



                    <a class="btn btn-default" href="/Course/ShowTopic/?PageIndex=1&Attribute=@ViewBag.Attribute&UserInfoId=@ViewBag.UserInfoId & TopicTitle = @ViewBag.TopicTitle">首页</a>
                    <a href="/Course/ShowTopic/?PageIndex=@(ViewBag.PageIndex-1)&Attribute=@ViewBag.Attribute&UserInfoId=@ViewBag.UserInfoId & TopicTitle = @ViewBag.TopicTitle" class="btn btn-default">上一页</a>

                    <a href="/Course/ShowTopic/?PageIndex=@(ViewBag.PageIndex+1)&Attribute=@ViewBag.Attribute&UserInfoId=@ViewBag.UserInfoId & TopicTitle = @ViewBag.TopicTitle" class="btn btn-default">下一页</a>
                    <a href="/Course/ShowTopic/?PageIndex=@ViewBag.PageCount  &Attribute=@ViewBag.Attribute& UserInfoId = @ViewBag.UserInfoId & TopicTitle = @ViewBag.TopicTitle" class="btn btn-default">尾页</a>
                    <span style="margin-left:50px">每页 <b style="color:#ff0000">@ViewBag.PageSize </b>条/共 <b style="color:#ff0000"> @ViewBag.PageCount</b> 页</span>









                    <div>
                        <label class="checkbox-inline"><input data-role="batch-select" id="ch" onclick="QX()" type="checkbox"> 全选</label>
                        <button class="btn btn-default btn-sm mlm" data-url="/admin/review/batch_delete" data-role="batch-delete" onclick="PLDelEstimate()" data-name="评价">删除</button>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <script>
        var app = {};
        app.debug = false;
        app.version = '6.9.6';
        app.httpHost = 'http://www.zhishile.com';
        app.basePath = '';
        app.theme = 'jianmo';
        app.themeGlobalScript = 'theme/global-script';
        app.jsPaths = { "common": "common", "theme": "\/themes\/jianmo\/js", "customwebbundle": "\/bundles\/customweb\/js", "customadminbundle": "\/bundles\/customadmin\/js", "topxiawebbundle": "\/bundles\/topxiaweb\/js", "topxiaadminbundle": "\/bundles\/topxiaadmin\/js", "classroombundle": "\/bundles\/classroom\/js" };

        app.crontab = '/common/crontab';

        var CKEDITOR_BASEPATH = app.basePath + '/assets/libs/ckeditor/4.6.7/';

        app.config = { "api": { "weibo": { "key": "" }, "qq": { "key": "" }, "douban": { "key": "" }, "renren": { "key": "" } }, "cloud": { "video_player": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/GrindPlayer.swf", "video_player_watermark_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Watermake-1.0.3.swf", "video_player_fingerprint_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Fingerprint-1.0.1.swf" }, "loading_img_path": "\/assets\/img\/default\/loading.gif?6.9.6" };

        app.arguments = {};
        app.controller = 'review/list';

        app.scripts = null;

        app.uploadUrl = '/file/upload';
        app.imgCropUrl = '/file/img/crop';
        app.lessonCopyEnabled = '0';

        app.mainScript = '/bundles/topxiaadmin/js/admin-app.js?6.9.6';
    </script>
    <script src="~/Content/js/sea.js"></script>
    <script src="~/Content/js/seajs-style.js"></script>
    <script src="~/Content/js/seajs-global-config.js"></script>
    <script>
        seajs.use(app.mainScript);
    </script>  <div id="modal" class="modal"></div>
    <div class="fixed-bar">
        <a href="/admin/feedback" target="_blank" class="icon-question-text feedback">
            <i class="es-icon es-icon-help"></i>
            <span>产品<br>反馈</span>
        </a>
    </div>


</body>
</html>
